package exception;

public class TryCatchDemo {
    public static void main(String[] args) {
        String line = null;
        System.out.println("系统开始");
        try {
            System.out.println(line.length());
        }
        catch (NullPointerException e) {
            System.out.println("出现问题");
        }
        catch (IndexOutOfBoundsException e) {
            System.out.println("出现异常");
        }

        System.out.println("系统结束");

    }
}
